<template>
  <div id="app">
    {{message}}
    <div>{{this.$store.state.account}}</div>
    <button @click="addNum">+1</button>
    <button @click="subNum">-1</button>
    <div>app getters相关信息</div>
    <div>getters进行计算：{{this.$store.getters.powerAccount}}</div>
    <hello-vuex :account="account" />
  </div>
</template>

<script>
import helloVuex from './component/hellovuex' 
export default {
  name: 'App',
  data() {
    return {
      message : 'App 组件',
      account : 0,
    }
  },
  methods: {
    addNum(){
      this.$store.commit('increment')
    },
    subNum(){
      this.$store.commit('decrement')
    }
  },
  components: {
    helloVuex,
  }
}
</script>

<style>

</style>
